<#include "/ftl/header.ftl">
<script type="text/javascript" >
    $(document).ready(function(){
        if ($("#errorMsg").val() != "") {
            $("#msg").html("账号或密码错误！");
            $(".alert-danger").show();
        }
        $(".btn-block").on("click",function(){

            if($("#adminName").val()==""){
                alert("用户名不能为空");
            }
            else if($("#passWord").val()==""){
                alert("密码不能为空");
            }else{
                $("#loginForm").submit();
            }
        });
        $(document).on("keypress",function(e){
            if(e.keyCode==13)
            {
                $(".btn-block").click();

            }
        });
    });
</script>
<title>善问管理系统</title>
<body >

<div class="container">

    <div class="login-block">
        <div class="block block-transparent" style="margin-top:40%;">

            <div class="content controls">
                <form id="loginForm" method="post" action="/admin/login">
                    <input type="hidden" id="errorMsg" value="${(message)!}" />
                    <div class="form-row user-change-row" style="display:block;">
                        <div class="col-md-12">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <span class="icon-user"></span>
                                </div>
                                <input type="text" class="form-control" placeholder="Login" id="adminName" name="adminName"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="col-md-12">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <span class="icon-key"></span>
                                </div>
                                <input type="password" class="form-control" id="passWord" name="passWord" placeholder="Password"/>
                            </div>

                            <div class="alert alert-danger"
                                 style="width: 80%; top: -350%; position: absolute; display: none;">

                                <strong id="msg"> </strong>
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>


                            </div>
                        </div>
                    </div>
                    <div class="form-row">

                        <div class="col-md-6">
                            <a href="#" class="btn btn-default btn-block btn-clean">登录</a>
                        </div>

                    </div>



                </form>
                <div class="form-row">
                    <div class="col-md-12">

                    </div>
                </div>
                <div class="form-row">
                </div>
                <div class="form-row">
                    <div class="col-md-12">
                    </div>
                </div>
                <div class="form-row">
                    <div class="col-md-12">
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

</body>
</html>












